package com.huaju.enity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * Paytype entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "paytype", catalog = "licai")
@JsonIgnoreProperties(value={"payoutlists","profits"})
public class Paytype implements java.io.Serializable {

	// Fields

	private Integer pid;
	private String pname;
	private Set<Payoutlist> payoutlists = new HashSet<Payoutlist>(0);
	private Set<Profit> profits = new HashSet<Profit>(0);

	// Constructors

	/** default constructor */
	public Paytype() {
	}

	/** full constructor */
	public Paytype(String pname, Set<Payoutlist> payoutlists,
			Set<Profit> profits) {
		this.pname = pname;
		this.payoutlists = payoutlists;
		this.profits = profits;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "pid", unique = true, nullable = false)
	public Integer getPid() {
		return this.pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	@Column(name = "pname")
	public String getPname() {
		return this.pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "paytype")
	public Set<Payoutlist> getPayoutlists() {
		return this.payoutlists;
	}

	public void setPayoutlists(Set<Payoutlist> payoutlists) {
		this.payoutlists = payoutlists;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "paytype")
	public Set<Profit> getProfits() {
		return this.profits;
	}

	public void setProfits(Set<Profit> profits) {
		this.profits = profits;
	}

}